import Services from "./httpBase";
function request() { }
// post 方法重新定义

request.prototype.post = function (url, data) {
    if (arguments.length == 2) {
        return Services.post(url, data)
    } else {
        return Services.post(url)
    }
}
// put 方法重新定义

request.prototype.put = function (url, data) {
    if (arguments.length == 2) {
        return Services.put(url, data)
    } else {
        return Services.put(url)
    }
}
// get 方法重新定义

request.prototype.get = function (url, data) {
    if (arguments.length == 2) {
        return Services.get(url, { params: data })
    } else {
        return Services.get(url)
    }
}
// delete 方法重新定义
request.prototype.delete = function (url, data) {
    if (arguments.length == 2) {
        return Services.delete(url, { parasm: data })
    } else {
        return Services.delete(url)
    }
}

export default new request()